<extend name="Extends/base"/>
<block name="title">登陆</block>
<block name="css">
    <link rel="stylesheet" href="__CST__/css/login.css?v={:C('JS_CSS_VERSION')}" type="text/css"/>
</block>
<block name="body_style"></block>
<block name="body">
    <div class="login-wrap login-wrap-small login-wrap-fixed">
        <div class="login-tit clearfix login-tit-mail">任务管理后台</div>
        <div class="login clearfix">
            <div class="signin-area">
                <div class="signin-area-bg">
                    <div class="padder">
                        <div class="input-boxer clearfix">
                            <span class="fl mr10"><i class="icon iconfont icon-gerenzhongxin"></i></span>
                            <input type="text" name="phone" value="" placeholder="请输入手机号">
                        </div>
                        <div class="input-boxer clearfix mt20 mb10">
                            <span class="fl mr10"><i class="icon iconfont icon-bianji"></i></span>
                            <input type="password" name="password" value="" placeholder="请输入密码">
                        </div>
                        <div class="remember-password clearfix mb20">
                            <a href="javascript:;" class="fr forget">忘记密码？</a>
                        </div>
                        <div class="sign-input-a">
                            <a href="javascript:;" class="login-btn c-btn-blue c-btn-full c-btn-rounded">登录</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="js">
    <script type="text/javascript" src="__CST__/js/api.login.js?v={:C('JS_CSS_VERSION')}"></script>
    <script type="text/javascript">
        $(function () {
            if ($(window).height() > 460) {
                $('.login-wrap').addClass('login-wrap-fixed');
            }

            //登陆页input效果
            $('.input-boxer input').each(function (index, element) {
                var $this = $(this);
                var word = $this.val();
                $this.bind('focus', function () {
                    $this.parent('.input-boxer').addClass('focus');
                    if ($this.val() != '' && $this.val() != word) {
                        return;
                    }
                    else {
                        $this.val('');
                    }
                }).bind('blur', function () {
                    $this.parent('.input-boxer').removeClass('focus');
                    if ($this.val() == '') {
                        $this.val(word);
                    } else {
                        return;
                    }
                })
            });
        });

        $('.login-btn').on('click', function () {
            var phone = $('input[name=phone]').val();
            var password = $('input[name=password]').val();

            if (!phone) {
                $.toast("登陆手机不能为空");
                return false;
            }

            if (!password) {
                $.toast("密码不能为空");
                return false;
            }

            doLogin(phone, password, function (res) {
                if (res.Code != 10000) {
                    $.toast(res.Message);
                    return false;
                }
                var url = $.sUrl("/Console/Index/index");
                location.href = url;
            });

        });

        //页面尺寸调整
        $(window).resize(function () {
            if ($(window).height() > 460) {
                $('.login-wrap').addClass('login-wrap-fixed');
            } else {
                $('.login-wrap').removeClass('login-wrap-fixed');
            }
        });

        //忘记密码弹窗
        $(".forget").on("click", function () {
            art.dialog({
                lock: true,
                artIcon: 'ask',
                opacity: 0.4,
                width: 300,
                title: '温馨提示',
                content: '忘记密码请联系管理员<br/>电话：0591-237423<br/>QQ：3423423<br/>邮箱：sdfk@jkzl.com',
                ok: function () {
                }
            });
        });
    </script>
</block>